# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=knotes
pkgver=24.02.2
pkgrel=0
# armhf blocked by extra-cmake-modules
# ppc64le, s390x, riscv64 and armv7 blocked by kdepim-runtime
arch="all !armhf !ppc64le !s390x !riscv64 !armv7"
url="https://kontact.kde.org/"
pkgdesc="Popup notes"
license="GPL-2.0-or-later AND LGPL-2.0-or-later AND GFDL-1.2-only"
depends="kdepim-runtime"
makedepends="
	akonadi-dev
	akonadi-notes-dev
	akonadi-search-dev
	extra-cmake-modules
	grantlee-dev
	grantleetheme-dev
	kcalutils-dev
	kcmutils-dev
	kcompletion-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kdnssd-dev
	kdoctools-dev
	kglobalaccel-dev
	kiconthemes-dev
	kitemmodels-dev
	kitemviews-dev
	kmime-dev
	knewstuff-dev
	knotifications-dev
	knotifications-dev
	knotifyconfig-dev
	kontactinterface-dev
	kparts-dev
	kpimtextedit-dev
	kstatusnotifieritem-dev
	ktextwidgets-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	kxmlgui-dev
	libkdepim-dev
	libxslt-dev
	pimcommon-dev
	qt6-qtbase-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/pim/knotes.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/knotes-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# knotesgrantleeprinttest is broken
	xvfb-run ctest --test-dir build --output-on-failure -E "knotesgrantleeprinttest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
a154259103f1304aede7c49ac8a1deacd81f1172eb99d78de7e41f05f6b7e9ecdbef70d3b00788c079f1859e3c3f675588328ca133dbbcd40753fc093225b488  knotes-24.02.2.tar.xz
"
